package liumengbaio.lolzhangyoubao.Activity.Fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import liumengbaio.lolzhangyoubao.Activity.Activity.ExchangeActivity;
import liumengbaio.lolzhangyoubao.Activity.Activity.MoreEquipActivity;
import liumengbaio.lolzhangyoubao.Activity.Activity.MoreHeroMomentActivity;
import liumengbaio.lolzhangyoubao.Activity.Activity.MoreNovelActivity;
import liumengbaio.lolzhangyoubao.Activity.Activity.MoreRecreationActivity;
import liumengbaio.lolzhangyoubao.Activity.Activity.MoreSkillsActivity;
import liumengbaio.lolzhangyoubao.Activity.Activity.MoreSpecialActivity;
import liumengbaio.lolzhangyoubao.Activity.Activity.MoreTreasureActivity;
import liumengbaio.lolzhangyoubao.Activity.Activity.MoreVoiceActivity;
import liumengbaio.lolzhangyoubao.Activity.Activity.MoreWallpaperActivity;
import liumengbaio.lolzhangyoubao.Activity.Activity.SelectHistoryActivity;
import liumengbaio.lolzhangyoubao.R;

/**
 * 更多界面
 * Created by lanouhn on 16/8/23.
 */
public class FragmentMore extends Fragment implements View.OnClickListener {

    private LinearLayout more_summoner, more_heroMoment, more_recreation, more_novel, more_treasure,
            more_wallpaper, more_convert, more_voice, more_equip, select_history, more_special;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_more, null);
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initView(getView());
        initEvent();
    }

    private void initView(View view) {
        more_summoner = (LinearLayout) view.findViewById(R.id.more_summoner);
        more_heroMoment = (LinearLayout) view.findViewById(R.id.more_heroMoment);
        more_recreation = (LinearLayout) view.findViewById(R.id.more_recreation);
        more_novel = (LinearLayout) view.findViewById(R.id.more_novel);
        select_history = (LinearLayout) view.findViewById(R.id.select_history);
        more_treasure = (LinearLayout) view.findViewById(R.id.more_treasure);
        more_wallpaper = (LinearLayout) view.findViewById(R.id.more_wallpaper);
        more_convert = (LinearLayout) view.findViewById(R.id.more_convert);
        more_voice = (LinearLayout) view.findViewById(R.id.more_voice);
        more_special = (LinearLayout) view.findViewById(R.id.more_special);
        more_equip = (LinearLayout) view.findViewById(R.id.more_equip);
    }

    private void initEvent() {
        more_summoner.setOnClickListener(this);
        more_heroMoment.setOnClickListener(this);
        more_recreation.setOnClickListener(this);
        more_novel.setOnClickListener(this);
        select_history.setOnClickListener(this);
        more_treasure.setOnClickListener(this);
        more_wallpaper.setOnClickListener(this);
        more_convert.setOnClickListener(this);
        more_voice.setOnClickListener(this);
        more_special.setOnClickListener(this);
        more_equip.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.select_history:
                Intent intent_select_history = new Intent(getActivity(), SelectHistoryActivity.class);
                startActivity(intent_select_history);
                break;
            case R.id.more_summoner:
                Intent intent_summoner = new Intent(getActivity(), MoreSkillsActivity.class);
                startActivity(intent_summoner);
                break;
            case R.id.more_heroMoment:
                Intent intent_hero = new Intent(getActivity(), MoreHeroMomentActivity.class);
                startActivity(intent_hero);
                break;
            case R.id.more_recreation:
                Intent more_recreation = new Intent(getActivity(), MoreRecreationActivity.class);
                startActivity(more_recreation);
                break;
            case R.id.more_novel:
                Intent more_novel = new Intent(getActivity(), MoreNovelActivity.class);
                startActivity(more_novel);
                break;
            case R.id.more_treasure:
                Intent more_treasure = new Intent(getActivity(), MoreTreasureActivity.class);
                startActivity(more_treasure);
                break;
            case R.id.more_wallpaper:
                Intent more_wallpaper = new Intent(getActivity(), MoreWallpaperActivity.class);
                startActivity(more_wallpaper);
                break;
            case R.id.more_convert:
                Intent more_convert = new Intent(getActivity(), ExchangeActivity.class);
                startActivity(more_convert);
                break;
            case R.id.more_voice:
                Intent more_voice = new Intent(getActivity(), MoreVoiceActivity.class);
                startActivity(more_voice);
                break;
            case R.id.more_special:
                Intent more_special = new Intent(getActivity(), MoreSpecialActivity.class);
                startActivity(more_special);
                break;
            case R.id.more_equip:
                Intent more_equip = new Intent(getActivity(), MoreEquipActivity.class);
                startActivity(more_equip);
                break;
        }
    }
}
